function removeElement(el) {
    var currentElement = document.getElementById(el);
    currentElement.parentNode.removeChild(currentElement);
}

function  InstallActiveXIE(id,clsid,width,height,param){
	try
	{
		removeElement(id);
		var s = "";
		s += ("<object id='"+id+"' width='"+width+"' height='"+height+"' classid='clsid:"+clsid+"'>");
		s += param;
		s += "</object>";
		document.open();
		document.write(s)
		document.close();
	}
	catch(e)
	{
		alert(e);
	}	
}

function isIE() { //ie?

    if (!!window.ActiveXObject || "ActiveXObject" in window)
       return true;
    else
        return false;
}

function fnExist(fnName) {  
	return fnName in this && typeof (eval(fnName)) == "function";  
}  

function objExist(obj) {
if (typeof(obj)=="undefined") 
 {return false;}
 else
 {return true;} 
}

function ocxConnect() {
	var ret = true;
	try
	{
         PicCtrl.SetThumbHwnd(THUMB_OCX.WebGetSafeHwnd()); // 连接缩略图控件和主显示控件
		 PicCtrl.SetTreeHwnd(TREE_OCX.WebGetSafeHwnd()); // 连接树视图控件和主显示控件	
	}
	catch(e)
	{
		ret = false;
	}		
	return ret;
}

function DisplayFileChange(strCurFileName) {
	try
	{
		var pos  = PicCtrl.GetDisplayFilePos(strCurFileName);
		var total= PicCtrl.GetCurFilesCount();
		var obj = document.getElementById("fpos");
		if(obj != undefined && obj != "undefined")
			obj.innerHTML = "当前位置：第<font color=red>" + pos + "</font>张/共计<font color=red>" + total + "</font>张影像";
	}
	catch(e)
	{
	}
}

function EventMsgNotify(strJsonMsg) {
	try
	{
		document.getElementById("ErrMsg").value = strJsonMsg;
		if(null == strJsonMsg || "" == strJsonMsg)
			return;
		document.getElementById("ErrMsg").value = strJsonMsg;
		var ocx_event = JSON.parse(strJsonMsg);
		if("20" == ocx_event.CMD || 20 == ocx_event.CMD)
		{
			if("" == ocx_event.PARAM1)
				document.getElementById("ErrMsg").value = "提交成功!";
			else
				document.getElementById("ErrMsg").value = ocx_event.PARAM1;
		}
	}
	catch(e)
	{
		alert(strJsonMsg+","+e);
	}
}

 /*---控件初始化准备开始 #重要---*/
var thumbctrl = 0, treectrl = 0, mainctrl = 0;
function doConnect() {
    var pctrl = document.getElementById("PicCtrl");
    if (pctrl == undefined || pctrl == "undefined") {
        return false;
    }
    return ocxConnect();	
}

function beginrun(src) {
    if("treewin" == src)
    {
        treectrl = 1;
    }
    else if("thumbwin" == src)
    {
        thumbctrl = 1;
    }
    else if("mainwin" == src)
    {
        mainctrl = 1;
    }		
    if (thumbctrl == 1 && treectrl == 1 && mainctrl == 1) {
        if(!doConnect())
        {
            window.setTimeout(_beginrun(src),3);			// !!! ----- 失败自动重联 -----!!!
        }
    }
}

function _beginrun(src){ 
    return function(){ 
          beginrun(src); 
    } 
} 

function setThumbHwndInit(hwnd) {
    thumbctrl = 1;
    beginrun("thumbwin");
}

function setTreelHwndInit(hwnd) {
    treectrl = 1;
    beginrun("treewin");
}

function setPicCtrlHwndInit(hwnd) {
    mainctrl = 1;
    beginrun("mainwin");
}
/*---控件初始化准备结束 #重要---*/
function fitscreen() {
    PicCtrl.SetDisplayFitWindow();
}
function fitimage() {
    PicCtrl.SetDisplayFitImage();
}

function ShowFirst() {
    var picobj = getObj("PicCtrl");
    picobj.ShowImgFirst();
}
function ShowLast() {
    var picobj = getObj("PicCtrl");
    picobj.ShowImgLast();
}
function ShowNext() {
    var picobj = getObj("PicCtrl");
    //    picobj.LoadBatchImage(localDir);
    picobj.ShowImgNext();
}
function ShowPre() {
    var picobj = getObj("PicCtrl");
    picobj.ShowImgPre();
}
function GetCurFileName() {
    var picobj = getObj("PicCtrl");
    var curFileName = picobj.GetFileNameByIndex(picobj.GetCurImgIndex);
    return curFileName.substr(curFileName.lastIndexOf("\\") + 1);
}
//////////////////////////////////////////////////////////////////////
// 函数名: ZoomOut
// 功  能: 放大图像，会保留比例。对下一张图像继续有效
// 返  回: function  -
function ZoomOut() {
    PicCtrl.SetDisplayZoomOut();
}

//////////////////////////////////////////////////////////////////////
// 函数名: ZoomIn
// 功  能: 缩小图像，会保留比例。对下一张图像继续有效
// 返  回: function  -
function ZoomIn() {
    PicCtrl.SetDisplayZoomIn();
}
function ZoomFit() {
    var picobj = getObj("PicCtrl");
    picobj.ZoomImage(0.3);
}

function bt2() {
	//alert(PicCtrl.GetCurVersion());
        PicCtrl.SetPageSplitNum(9);
        THUMB_OCX.SetWorkMod(17);//THUMB_OCX.SetWorkMod(31);
        TREE_OCX.SetWorkMod(31);//TREE_OCX.SetWorkMod(25);//关掉树右键删除
	PicCtrl.SetInitParamter("ServerName","10.200.7.46");//192.168.8.243
	PicCtrl.SetInitParamter("SvrCommPort","8080");
		//PicCtrl.SetInitParamter("LoginUser","admin");
		//PicCtrl.SetInitParamter("LoginPwd","admin");
		//PicCtrl.SetInitParamter("ConfDescript","测试环境");
		PicCtrl.SetAppDocOwner(document.myForm.DocOwner.value);//文件的所有人
	//PicCtrl.SetSysVisitLimit("身份证明材料");
        localDir = "";
        // 参数1 ："runlog"表示运行时记录调试信息日志，否则只是在出现严重错误时记录日志
        // 参数2 ：业务受理时间
        // 参数3 ：业务受理批次号
        // 参数4 ：业务条码号
        // 参数5 ：控件的工作模式(4查看模式，5新建模式，6追加模式)
        //PicCtrl.SetSysVisitLimit("企业法人");//不允许用户看企业法人节点下的图片
	PicCtrl.SetSupportDocType("*");
	PicCtrl.SetSysLimitFileSize(1000241024);
	var apptime = document.myForm.AppTime.value;
	PicCtrl.SetAppSearchDate(apptime);
	PicCtrl.ClearParamter();
	PicCtrl.SetParamter("MarkFlag","1");//0关闭水印，非0开启打印图像附带水印功能，默认为关闭
	PicCtrl.SetParamter("MarkAlpha","0.7");//0.1~0.9，0不透明，1完全透明，默认值0.7
	PicCtrl.SetParamter("MarkText","影像平台系统V2.1");
	PicCtrl.SetParamter("MarkFrontR","255");//水印文字颜色R分量，默认为255
	PicCtrl.SetParamter("MarkFrontG","255");//水印文字颜色G分量，默认为255
	PicCtrl.SetParamter("MarkFrontB","255");//水印文字颜色R分量，默认为255
	PicCtrl.SetParamter("MarkFontSize","36");//水印字体大小，默认为72
	PicCtrl.SetParamter("MarkFontPosX","40");//水印开始x坐标位置，默认为0
	PicCtrl.SetParamter("MarkFontPosY","440");//水印开始y坐标位置，默认为0
	var localstatus=PicCtrl.IsExistDocId2(document.myForm.AppID.value,document.myForm.SiteID.value,document.myForm.UserID.value, document.myForm.DocID.value,apptime,document.myForm.selectRep.value);
	if("10000001" == localstatus)
	{
		//alert("10000001,新建");
		document.myForm.openMode.value = "105";
	}
	else if(50 != localstatus.length)
	{
		alert(PicCtrl.GetErrorDescript());
		return;
	}
	else
	{
		//alert("正常调阅");
		document.myForm.openMode.value = "101";
	}
	PicCtrl.SetSubmitParameters("OPERNAME",document.myForm.tellername.value);
	PicCtrl.SetSubmitParameters("OPERSYS",document.myForm.tellersys.value);
	PicCtrl.SetSubmitParameters("OPERORG",document.myForm.UserOrg.value);
	PicCtrl.SetSubmitParameters("BUSISTATUS",document.myForm.bfstatus.value);
	var workParam = '{"SYSID":"'+document.myForm.AppID.value+'","SUBSYSID":"'+document.myForm.SiteID.value+'","APPLCDE":"'+document.myForm.DocID.value+'","APPOPER":"'+document.myForm.UserID.value+'","APPDATE":"'+apptime+'","APPMOD":"'+document.myForm.openMode.value+'","DOCPRDNO":"'+document.myForm.DocPRDNO.value+'"}';
    PicCtrl.Run2(workParam, "", "",document.myForm.selectRep.value);
}

function getObj(objid) {
    return document.getElementById(objid);
}

function btsubmit() {
    var i, docid = PicCtrl.DocIDGet();
    if (docid == "")
        alert("没有可提交文档!");
    else {

        var sarray = new Array();
        sarray = docid.split('|');
        for (i = 0; i < sarray.length; i++) {
            //alert("正在提交文档："+sarray[i]);
            if (PicCtrl.SubmitDoc(sarray[i]) > 0)
                alert("新增文件:" + PicCtrl.GetOptFilesAdd() + ",修改文件:" + PicCtrl.GetOptFilesChg() + ",删除文件:" + PicCtrl.GetOptFilesDel());
        }
    }
}

function btsubmitsync()
	{
        var i, docid = PicCtrl.DocIDGet();
        if (docid == "")
            alert("没有可提交文档!");
        else {

            var sarray = new Array();
            sarray = docid.split('|');
            for (i = 0; i < sarray.length; i++) {
                //alert("正在提交文档："+sarray[i]);
                if (PicCtrl.SubmitDocSync(sarray[i]) > 0)
                    alert("新增文件:" + PicCtrl.GetOptFilesAdd() + ",修改文件:" + PicCtrl.GetOptFilesChg() + ",删除文件:" + PicCtrl.GetOptFilesDel());
            }
        }
	}
	
	function submita006()
	{
        var docid = PicCtrl.DocIDGet();
        if (docid == "")
            alert("没有可提交文档!");
        else {
            alert(PicCtrl.SubmitDocForPT());
        }	
	}
	
    function copysubmit() {
        var docid = PicCtrl.DocIDGet();
        if (docid == "")
            alert("没有可提交文档!");
        else {
            PicCtrl.SubmitDocCopy(document.myForm.AppID.value, document.myForm.SiteID.value, document.myForm.UserID.value, document.myForm.DocIDcpy.value);
        }
    }

    function btmutiltest() {
        PicCtrl.MutilThreadTest(300);
    }
	function bt3() {
		try
		{
			var strMemo = PicCtrl.GetCurDirMemo();
			var strCurDir=PicCtrl.DirGetCurrentDefault();
			var strDelta = PicCtrl.DirGetFiles(strCurDir, 0);
			var num;
			if(("" == strDelta)||("|" == strDelta))
			{
				num = 1;
			}
			else
			{
				var sarray = new Array();
				sarray = strDelta.split('|');	//sarray.length是当前目录中的文件数		
				num = sarray.length+1;
			}

			var strfile = PicCtrl.SelectDiskFileEx();
			if("" == strfile)
				return;
			var filename = JSON.parse(strfile);
			PicCtrl.ExternalWriteLog("filename.F_PATH="+filename.F_PATH);
			var i=0;
			for(i=0;i<filename.F_INFOS.length;i++)
			{
				/*
				alert(filename.F_INFOS[i].F_OLDNAME);
				filename.F_INFOS[i].F_MEMO = filename.F_INFOS[i].F_OLDNAME;
				*/
				if(0 < strMemo.length)
				{
					filename.F_INFOS[i].F_MEMO = filename.F_INFOS[i].F_OLDNAME;
				}
			}
			strfile = JSON.stringify(filename);
			PicCtrl.ScannerAddFileForJson(strfile);
			//strfile = strfile.replace(/"/g, '\"');
			//alert(strfile);
			
			
			/*
			var filename = JSON.parse(PicCtrl.SelectDiskFileEx());
			PicCtrl.ExternalWriteLog("filename.F_PATH="+filename.F_PATH);
			var i=0;
			for(i=0;i<filename.F_INFOS.length;i++)
			{
				PicCtrl.ExternalWriteLog("filename.F_INFOS["+i+"].F_FILENAME"+filename.F_INFOS[i].F_FILENAME+",filename.F_INFOS["+i+"].F_OLDNAMEE"+filename.F_INFOS[i].F_OLDNAME);
			}
			*/
		}
		catch(e)
		{
			alert(e);
		}	
	}
/*//2015-03-18 delete
    function bt3() {
        var filename = PicCtrl.SelectDiskFile();
        if (filename != "") {
            var sarray = new Array();
            sarray = filename.split('|');
            for (i = 0; i < sarray.length; i++) {
                if (sarray[i] != "") {
                    var len = sarray[i].lastIndexOf(".");

                    var Extfile = sarray[i].substring(len+1);
                    //alert(Extfile);
					var s1 = document.getElementById("cms").getQRcodeResult("11","11",sarray[i]);
					alert(s1);
					var s2 = document.getElementById("cms").getOCRResult("TE","11",sarray[i]);
					alert(s2);
                    if (Extfile == "JPG" || Extfile == "jpg")
                        PicCtrl.ScannerAddFile(sarray[i], true);
                    else
                        PicCtrl.ScannerAddFile(sarray[i], false);
                }
            }
        }

    }
*/
    ////扫描功能函数
    var localDir = "";
    function chkinfo() {
        if (document.myForm.AppID.value == "") {
            alert("请输入应用号！");
            return false;
        }
        if (document.myForm.SiteID.value == "") {
            alert("请输入机构号！");
            return false;
        }
        if (document.myForm.UserID.value == "") {
            alert("请输入柜员号！");
            return false;
        }
        if (document.myForm.DocID.value == "") {
            alert("请输入DOCID！");
            return false;
        }
        return true;
    }
    function show(fileName) {
        var picobj = getObj("PicCtrl");
        picobj.ScannerAddFile(fileName, true);
    }
    function SelectScan() {
        SCAN_OCX.TwainSelect();
    }

    function scan(rescan_flag) {
        if (!chkinfo())
            return;
        var file_path;
        file_path = PicCtrl.GetWorkSpacePath(true);
        if (file_path == "") {
            alert("请先点开始运行按钮！");
            return;
        }
        var m_Duplex = document.myForm.Duplex.value;
        var m_ShowUI = document.myForm.ShowUI.value;
        var m_ColorMode = document.myForm.ColorMode.value;
        var m_Contrast = document.myForm.Contrast.value;
        var m_Intensity = document.myForm.Intensity.value;
        var m_ADF = document.myForm.ADF.value;
        var m_Res = document.myForm.Res.value;
        var m_MaxPages = document.myForm.MaxPages.value;

        //设置扫描参数
        SCAN_OCX.TwainSetXferCount(parseInt(m_MaxPages));
        SCAN_OCX.TWainSetScanADF(m_ADF);
        SCAN_OCX.TwainSetEnableDuplex(rescan_flag == 1 ? 0 : m_Duplex);
        //根据颜色模式确定扫描图像位数
        SCAN_OCX.TwainSetContrast(parseInt(m_Contrast));
        SCAN_OCX.TwainSetIntensity(parseInt(m_Intensity));
        SCAN_OCX.TwainSetColorMode(parseInt(m_ColorMode));
        SCAN_OCX.TwainSetShowUI(m_ShowUI);
        SCAN_OCX.TwainSetDPI(parseInt(m_Res));

        SCAN_OCX.SetFileSaveNumber(PicCtrl.GetScannerSeries());
        SCAN_OCX.SetFileSavePath(file_path);
        SCAN_OCX.SetFileSaveType(1);
        SCAN_OCX.BeginScan();

        return;
        document.myForm.submitResult.value = '结束扫描';



        var file_path;
        //var m_docindex = document.myForm.docindex.value;
        if (localDir == "") {
            //PicCtrl.ClearDisplay();
            //PicCtrl.ClearList();
            file_path = PicCtrl.GetWorkSpacePath(true);
            if (file_path == "") {
                alert("获取存储路径失败！");
                return;
            }
        }
        //扫描存放路径

        //alert("= "+m_MaxPages+"="+m_Duplex+"="+m_ShowUI+"="+parseInt(m_ColorMode)+
        //"="+m_Contrast+"="+m_Intensity+"="+m_ADF+"="+m_Res+"filepath="+localDir);



        SCAN_OCX.SetPath(localDir);
        //开始扫描
        SCAN_OCX.BeginScan();
    }
    var all_message = new String("");
    //解析消息，获取影像文件信息(名称，大小，格式，正反面，文件序号)
    var current_message = new String("");
    function putMessage(message) {
        current_message = localDir + "\\" + message;
        show(message);
    }
    function showMessage() {
        window.status = "";
    }

    //结束扫描
    function cancleScan() {
        SCAN_OCX.StopScan();
    }

    //检查扫描参数
    function check() {
        //document.myForm.cancel.disabled=true;
        window.status = "正在扫描...";
        scan(0);
    }

    function del() { }
    //重扫
    function rescan() {
        var picobj = getObj("PicCtrl");
        var curFileName = picobj.GetFileNameByIndex(picobj.GetCurImgIndex);
        alert("重扫文件 = " + current_message);
        SCAN_OCX.TwainDeleteFile(current_message);
        scan(1);
    }
	function mydirprint()
	{
		var dirinfo="";
		var barCode="";
		try
		{
			dirinfo=PicCtrl.DirGetCurSelected("",1);//0获得所有目录，1获得选中目录
            var sarray = new Array();
            sarray = dirinfo.split('|');
            for (i = 0; i < sarray.length; i++) {
                if (sarray[i] != "") {			
					barCode="{\"ACT\":\"1\",\"ID\":\"\",\"SID\":\"\",\"SN\":\"\",\"DIR\":\""+sarray[i]+"\"}";
					getObj("PicCtrl").ExternalWriteLog("调用二维码打印程序 开始");
					printCode(barCode,sarray[i]);
					getObj("PicCtrl").ExternalWriteLog("调用二维码打印程序 开始");
				}
			}
			
		}
		catch(e)
		{}	
	}

    function  printCode(CodeContent,descript){
		// 调用二维码的打印代码，打印二维码
		//CodeContent是要生成码的内容，descript是要打印的文字信息
		alert(CodeContent+","+descript);
		//cms.print(CodeContent,descript);
	}

    function myOcrRead()
	{
		var fileinfo = PicCtrl.GetCurDisplayObjJson();
		if(null == fileinfo || "" == fileinfo)
			return;
		try
		{
			var fileobj = JSON.parse(fileinfo);
			PicCtrl.ExternalWriteLog("开始OCR识别文件["+fileobj.F_FILENAME+"]");
			alert(fileobj.F_FILEPATH);//调用OCR接口,这里调用第三方公司的产品
			PicCtrl.OCRInfoAdd(fileobj.F_FILENAME,"识别后信息");
			PicCtrl.ExternalWriteLog("完成OCR识别文件["+fileobj.F_FILENAME+"]");
		}
		catch(e)
		{
			alert(e);
		}			
	}


function selectdir()
	{
		var str,path  = PicCtrl.SelectDiskDirectory("请选择文件要保存的目录",1);
		if("" != path && "User Cancel" !=path)
		{
			try
			{
				str = PicCtrl.DirGetCurSelected("",2);
				if("" == str)
				{
					alert("请勾选要保存的文件");
					return;
				}
				var sarray = new Array();
				sarray = str.split('|');
				for (i = 0; i < sarray.length; i++) {
					if("" == sarray[i])
						continue;
					PicCtrl.SaveFileToDisk(sarray[i],"",path);
				}
			}
			catch(e)
			{
				alert(e);
			}	
		}
		else if("User Cancel" != path)
			{
				alert(PicCtrl.GetErrorDescript());
			}
	}
	function showtextmb()
	{
		//PicCtrl.RotateRight90();
		//PicCtrl.RotateLeft90();
		var ok = PicCtrl.ShowMessageBoxMd("信息提示","提交完成");
		alert(ok);
	}
	function showtext()
	{
		//PicCtrl.RotateRight90();
		//PicCtrl.RotateLeft90();
		PicCtrl.ShowMessageBox("信息提示","提交完成");
	}
	
    function kernerldebug() {
	PicCtrl.InterFaceInit2('{"APPID":"xd0001","SAPID":"cb00000001","TELLER":"f000000001"}');
		/*
		try
		{
			alert(PicCtrl.DirGetCurrentDefault());//alert(document.getElementById("PicCtrl").readyState);
		}
		catch(e)
		{
		}

		try
		{
			alert(PicCtrl.DirGetCurSelected("",1));
		}
		catch(e)
		{}	
	
	alert(1);
	alert(document.getElementById("cms").getOCRResult("TE","11","D:\\YGD.jpg"));	
	alert(2);
	try
	{
		var filename = JSON.parse(PicCtrl.SelectDiskFileEx()); //eval('('+PicCtrl.SelectDiskFile()+')');
		PicCtrl.ExternalWriteLog("filename.F_PATH="+filename.F_PATH);
		var i=0;
		for(i=0;i<filename.F_INFOS.length;i++)
		{
			PicCtrl.ExternalWriteLog("filename.F_INFOS["+i+"].F_FILENAME"+filename.F_INFOS[i].F_FILENAME+",filename.F_INFOS["+i+"].F_OLDNAMEE"+filename.F_INFOS[i].F_OLDNAME);
		}
	}
	catch(e)
	{
		alert(e);
	}
	*/
        PicCtrl.SetKernerlDebug(1);
        //alert(PicCtrl.DlgGetCurDirMemo("提示1", "请输入文件名1"));
		/*
		try
		{
			alert(PicCtrl.DirGetCurSelected("",1));
		}
		catch(e)
		{}
				try
				{
                	PicCtrl.SetThumbHwnd(THUMB_OCX.WebGetSafeHwnd()); // 连接缩略图控件和主显示控件
					alert("ok thumb");
					PicCtrl.SetTreeHwnd(TREE_OCX.WebGetSafeHwnd()); // 连接树视图控件和主显示控件	
					alert("ok tree");
				}
				catch(e)
				{
					alert(e);
				}	*/	
    }
		/*
			var filename = JSON.parse(str);
			for(i=0;i<filename.length;i++)
			{
				alert(filename[i].PATH);
			}
			*/	
	var strRealDirName = "/主申请人资料/身份证明材料/身份证"; // 所有文件统一追加到此目录中
	//var strRealDirName = "/我不存在/你能怎么着/欠收拾"; // 所有文件统一追加到此目录中
	function PackforCmdDirAdd(strDirName,strDirPath)
	{
		//增加已存在目录会返回Directory already exist
		return '{\"VER\":\"1\",\"CMD\":\"DirAdd\",\"PARAMS\":{\"NAME\":\"'+strDirName+'\",\"DIR\":\"'+strDirPath+'\",\"MEMO\":\"'+strDirName+'\"},\"EXT\":\"\"}';
	}
	function PackforCmdDirDel(strDirPath)
	{
		return '{\"VER\":\"1\",\"CMD\":\"DirDel\",\"PARAMS\":\"{\\\"DIR\\\":\\\"'+strDirPath+'\\\"}\",\"EXT\":\"\"}';
	}	
	function PackforCmdFileCopyInto(strDirPath)
	{
		return '{\"VER\":\"1\",\"CMD\":\"FileCopyInto\",\"PARAMS\":\"{\\\"PATH\\\":\\\"'+strDirPath+'\\\"}\",\"EXT\":\"\"}';
	}	
	//strSYS系统编号，strSUBSYS子系统编号,strSN业务流水号,strFilePath文件物理路径，strDir树路径，strOWR文件所有人编号,
	function PackforCmdFileAdd(strSYS,strSUBSYS,strSN,strFilePath,strDir,strOWR)
	{
		return '{\"VER\":\"1\",\"CMD\":\"FileAdd\",\"PARAMS\":{\"SYS\":\"'+strSYS+'\",\"SUBSYS\":\"'+strSUBSYS+'\",\"SN\":\"'+strSN+'\",\"PATH\":\"'+strFilePath+'\",\"DIR\":\"'+strDir+'\",\"RLDIR\":\"'+strRealDirName+'\",\"OWR\":\"'+strOWR+'\"},\"EXT\":\"\"}';
	}		
    function test2() {
	//添加文件夹
	var strDirName = "00001202";
	var strParentPath="/";
	var str = PicCtrl.DoScriptCmd(PackforCmdDirAdd(strDirName,strParentPath));
	if(0 < str.length)
	{
		alert(str);
		return;
	}
	var strNewPath=strParentPath+"/"+strDirName;
	var str = PicCtrl.DoScriptCmd(PackforCmdDirAdd("通用分类目录",strNewPath));
	if(0 < str.length)
	{
		alert(str);
		return;
	}	
	//删除文件夹
	var strDelPath=strNewPath+"/"+"通用分类目录";
	//str = PicCtrl.DoScriptCmd(PackforCmdDirDel(strDirName,strParentPath));
	//if(0 < str.length)
	//	alert(str);	
	var strSYS,strSUBSYS,strSN,strFilePath,strDir,strOWR;
	str = PicCtrl.DoScriptCmd(PackforCmdFileAdd("xd0001","cb00000001","123456","f:/pictures/girls/1.jpg",strDelPath,""));
	str = PicCtrl.DoScriptCmd(PackforCmdFileAdd("xd0001","cb00000001","223456","f:/pictures/girls/2.jpg",strDelPath,""));
	if(0 < str.length)
		alert(str);			
	/*
		var szOrgFile="C:/Users/weixing/AppData/Local/Temp/p0000ff.jpg";
        var str = '[{"ACT":"1","ID":"","SID":"","SN":"","DIR":"/家访报告/家访报告","PATH":"C:/Users/weixing/AppData/Local/Temp/p00001a.jpg"},{"ACT":"1","ID":"","SID":"","SN":"","DIR":"/合同文本类/合同文本类","PATH":"C:/Users/weixing/AppData/Local/Temp/p00002a.jpg"}]';
		try
		{
			PicCtrl.CloneAddFiles(str, szOrgFile,0);
		}
		catch(e)
		{
			alert(e);
		}	
		*/
    }
	
    function test() {
        alert(PicCtrl.DocIDGet());
        alert(THUMB_OCX.GetThumbFiles());
    }
    function pageup() {
		PicCtrl.PageUp();
    }
    function pagedown() {
        PicCtrl.PageDown();
    }



